import request from './request';

// 分页查询用户
export function getUserPage(data) {
  return request({
    url: '/api/user/page',
    method: 'post',
    data
  });
}

// 根据ID获取用户
export function getUserById(id) {
  return request({
    url: `/api/user/${id}`,
    method: 'get'
  });
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/api/user',
    method: 'post',
    data
  });
}

// 更新用户
export function updateUser(data) {
  return request({
    url: '/api/user',
    method: 'put',
    data
  });
}

// 删除用户
export function deleteUser(id) {
  return request({
    url: `/api/user/${id}`,
    method: 'delete'
  });
} 